{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "68118872",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " National\n"
     ]
    }
   ],
   "source": [
    "str=\"the National Day\"\n",
    "print(str[3:12])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "3517085b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "National\n"
     ]
    }
   ],
   "source": [
    "list=[\"the\",\"National\",\"Day\"]\n",
    "print(list[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "7eae5537",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(['Today', 'is', 'the'], 'National', 'Day')\n"
     ]
    }
   ],
   "source": [
    "tpl=(['10.1','is','the'],'National','Day')\n",
    "tpl[0][0]='Today'\n",
    "print(tpl)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5aec5028",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'name': 'J Hotle', 'count': 38, 'price': 162}\n"
     ]
    }
   ],
   "source": [
    "Hotel={'name':'J Hotle','count':35,'price':162}\n",
    "Hotel.update({'count':38})\n",
    "print(Hotel)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "403c518f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "False\n"
     ]
    }
   ],
   "source": [
    "Hset={'A Hotel','B Hotel','C Hotel'}\n",
    "result='E Hotel'in Hset\n",
    "print(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "ecbc4d89",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col1</th>\n",
       "      <th>col2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>b</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>d</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   col1 col2\n",
       "0     1    a\n",
       "1     2    b\n",
       "2     3    c\n",
       "3     4    d"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "dict1={'col1':[1,2,3,4],'col2':['a','b','c','d']}\n",
    "df=pd.DataFrame(dict1)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "d8cce8b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col1</th>\n",
       "      <th>col2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>b</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>d</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   col1 col2\n",
       "0     1    a\n",
       "1     2    b\n",
       "2     3    c\n",
       "3     4    d"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lista=[1,2,3,4]\n",
    "listb=['a','b','c','d']\n",
    "df=pd.DataFrame({'col1':lista,'col2':listb})\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "dde2edad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b   c   d\n",
       "0  1   2   3   4\n",
       "1  5   6   7   8\n",
       "2  9  10  11  12"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "data=pd.DataFrame([[1,2,3,4],\n",
    "                   [5,6,7,8],\n",
    "                   [9,10,11,12]],\n",
    "                  columns=['a','b','c','d'])\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "254c578e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   0  1  2\n",
       "0  1  2  3\n",
       "1  4  5  6"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "a=np.array([[1,2,3],[4,5,6]])\n",
    "b=pd.DataFrame(a)\n",
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "1883a594",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[86 88]\n",
      "[88 82 84 86 81]\n",
      "[80 81 75 83 75]\n",
      "[81.4 81.6]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "stus_score=[80,88],[82,81],[84,75],[86,83],[75,81]\n",
    "result1=np.max(stus_score,axis=0)\n",
    "print(result1)\n",
    "result2=np.max(stus_score,axis=1)\n",
    "print(result2)\n",
    "result3=np.min(stus_score,axis=1)\n",
    "print(result3)\n",
    "result4=np.mean(stus_score,axis=0)\n",
    "print(result4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "c22be98b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_train的维度： (112, 4)\n",
      "X_test的维度： (38, 4)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.datasets import load_iris\n",
    "iris_dataset=load_iris()\n",
    "X_train,X_test,y_train,y_test=train_test_split(iris_dataset['data'],iris_dataset['target'],random_state=0)\n",
    "print(\"X_train的维度：\",format(X_train.shape))\n",
    "print(\"X_test的维度：\",format(X_test.shape))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "c5f6a296",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\IPython\\core\\interactiveshell.py:3444: FutureWarning: In a future version of pandas all arguments of read_csv except for the argument 'filepath_or_buffer' will be keyword-only\n",
      "  exec(code_obj, self.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6mHNZeN53W10ua7p7lt6zH3kKyenwMXRsRi4GOkAIL0tS/N3Evq3ZD9vHeGbTmNdMj2tprtPwsMA0hSgzZbH3EgGcA5kiaz2/tI3xl0WHbo9B7gwWms6xLgldlzdyXVk2biRuBM4Kbs8Y5V04+W9ANSXWsmbbaC8KkjZlYY7iGZWWE4kMysMBxIZlYYDiQzKwwHkpkVhgPJzArDgWRmhfH/AULyicwzD9D/AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 720x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "data=pd.read_csv('iris.txt',\",\",header=None)\n",
    "df=pd.DataFrame(data)\n",
    "df.columns=['LenPatel','LenSepal']\n",
    "plt.rcParams['font.sans-serif']=['SimHei']\n",
    "plt.figure(figsize=(10,10))\n",
    "plt.subplot(2,2,1)\n",
    "plt.xlabel('Len of Patel',fontsize=10)\n",
    "plt.ylabel('Len of Sepal',fontsize=10)\n",
    "plt.title(\"鸢尾花花瓣/花萼长度散点图\")\n",
    "plt.scatter(df['LenPatel'],df['LenSepal'],c='red')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "0a2411d7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "最佳拟合线：y= -25 + 4 *x\n",
      "系数： [[4.78481013]]\n",
      "截距： [-25.74683544]\n",
      "投资2千万的电影预计票房收入 69.9493670886076 千万元\n"
     ]
    }
   ],
   "source": [
    "from sklearn import linear_model\n",
    "import matplotlib.pyplot as plt\n",
    "X=[[6],[9],[12],[14],[16]]\n",
    "y=[[9],[12],[29],[35],[59]]\n",
    "model=linear_model.LinearRegression()\n",
    "model.fit(X,y)\n",
    "a=model.predict([[20]])\n",
    "b=model.intercept_\n",
    "w=model.coef_\n",
    "print(\"最佳拟合线：y=\",int(b),\"+\",int(w),\"*x\")\n",
    "print(\"系数：\",w)\n",
    "print(\"截距：\",b)\n",
    "print(\"投资2千万的电影预计票房收入\",format(model.predict([[20]])[0][0]),\"千万元\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "af9389c4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from kneighbors import TfidfVection\n",
    "data=pd.read_csv('hot-spicy pot.csv',\",\")\n",
    "header=10"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
